﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using YSC_Services.BLL.Services.Interfaces;

namespace YSC_App_WebApi.Controllers
{
    /// <summary>
    /// 数据更新
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    [ApiExplorerSettings(IgnoreApi = true)]
    public class BasisDataUpdateController : ControllerBase
    {
        private IBasisDataUpdateAppServices _pro;
        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="pro"></param>
        public BasisDataUpdateController(IBasisDataUpdateAppServices pro)
        {
            this._pro = pro;
        }


        /// <summary>
        ///鱼种信息更新
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("GetFishSpeciesUpdate")]
        public ActionResult GetFishSpeciesUpdate()
        {
            var ret = _pro.FishSpeciesUpdate();
            return Ok(ret);
        }

        /// <summary>
        /// 产地单位同步
        /// </summary>
        /// <param name="name">所属库</param>
        /// <returns></returns>
        [HttpGet]
        [Route("PlaceOfOriginUnitUpdate")]
        public ActionResult PlaceOfOriginUnitUpdate(string name)
        {
            var ret = _pro.PlaceOfOriginUnitUpdate(name);
            return Ok(ret);
        }

    }
}